import { User } from 'src/views/user/entities/user.entity';
import {
  Column,
  CreateDateColumn,
  Entity,
  ManyToOne,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity({
  name: 'inform',
})
export class Inform {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    length: 1024,
    comment: '消息内容',
  })
  content: string;

  @Column({
    comment: '消息类型 0 普通 1紧急',
    length: 20,
    default: '1',
  })
  type: string;

  @Column({
    comment: '消息状态 0 已读 1未读',
    length: 20,
    default: '1',
  })
  status: string;

  @CreateDateColumn({
    comment: '创建时间',
  })
  createTime: Date;

  @UpdateDateColumn({
    comment: '更新时间',
  })
  updateTime: Date;

  @Column({
    comment: '是否删除 0 删除 1正常',
    length: 20,
    default: '1',
  })
  isDetele: string;

  @ManyToOne(() => User)
  user: User;
}
